<template>
  <div class="list-page">
    <cityName class="cityName"></cityName>
    <van-nav-bar left-arrow @click-left="$router.push('/home')" />
    <areaName></areaName>
    <router-view></router-view>
    
  </div>
</template>

<script>
import cityName from "@/components/cityName";
import areaName from "@/components/areaName";
import { housesListApi } from "@/api/list";
export default {
  components: {
    cityName,
    areaName,
  },
  name: "list-page",

  methods: {},
  data() {
    return {
      flag: true,
      cityId: "",
      housesList: [],
    };
  },
  async created() {
    if (localStorage.getItem("sel_city")) {
      this.cityId = JSON.parse(localStorage.getItem("sel_city")).value;
      console.log(this.cityId);
    }
    const res = await housesListApi({ cityId: this.cityId });
    this.housesList = res.body.list;
    console.log(this.housesList);
  },
};
</script>

<style lang="less" scoped>
.van-search {
  background-color: #21b97a;
}
.van-nav-bar {
  position: relative;
  background-color: #1cb676;
}
.van-nav-bar .van-icon {
  color: #fff;
}
.van-ellipsis {
  font-size: 18px;
  // color: #fff;
}
.cityName {
  position: absolute;
  z-index: 3;
  margin: 3px, 10px;
}
.van-card {
  z-index:50
}
</style>
